<?xml version='1.0' encoding='UTF-8' ?>
<!--

    Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Duke's RSVP - Event Status</title>
        <h:outputStylesheet name="default.css" library="css" />
    </h:head>
    <h:body>
        <h1>Responses for <h:outputText value="#{eventManager.currentEvent.name}" /></h1>
        <h:form>
            <h:dataTable var="response"
                         summary="List of all responses for Event"
                         value="#{eventManager.retrieveEventResponses()}">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Name" />
                    </f:facet>
                    <h:outputText value="#{response.person.firstName} #{response.person.lastName}" />
                </h:column>
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="Status" />
                    </f:facet>
                    <h:commandLink value="#{response.responseText}"
                                   action="#{eventManager.viewResponse(response)}" />
                </h:column>
            </h:dataTable>
        </h:form>
        <br />
        <h:link outcome="index"
                value="Back to the main page." />
    </h:body>
</html>

